#!/usr/bin/env python3
# $Id: test3-0.py 7c6bb3d1dea5 2012/08/26 01:44:08 pgurumur $
# Copyright (c) 2012 Prabhu Gurumurthy <pgurumur@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

__version__  = "$Revision: 7c6bb3d1dea5 $"
__author__   = "$Author: pgurumur $"
__modified__ = "$Date: 2012-08-26 01:44:08Z $"

import random

from venya3.lib import ip
from venya3.lib import stdlib

if __name__ == "__main__":
   randstr = stdlib.GetRandomString(random.randint(10, 30))
   print(randstr, type(randstr))

   testip = "172.29.17.1"
   print(testip, type(testip))

   print("{0!s}".format(testip).encode('utf-8'))

   testaddr = ip.ip(testip)
   print(testaddr)
   print(int(testaddr))
   print(hex(testaddr))
   print(oct(testaddr))
   print(len(testaddr))
